package com.wuyou.sso2.handler.login;

import com.wuyou.sso.common.entity.User;
import com.wuyou.sso.common.enums.LoginTypeEnum;
import com.wuyou.sso2.vo.UserVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 用户密码处理器
 *
 * @author lishangbu
 * @date 2021/4/9
 */
@Slf4j
@Component
public class DefaultPasswordLoginHandler implements LoginHandler {

//    @DubboReference(check=false)
//    private RemoteUserService remoteUserService;

    @Override
    public String identify(String identifyStr) {
        return identifyStr;
    }

    @Override
    public UserVO info(String identify) {
//        return remoteUserService.getUserByUserName(identify);
        return new UserVO();
    }

    @Override
    public void bind(User user, String identify) {
        throw new UnsupportedOperationException("不支持用户绑定操作");
    }

    @Override
    public Boolean support(LoginTypeEnum type) {
        return LoginTypeEnum.PWD.equals(type);
    }
}
